﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Data;

namespace Bluebunnie
{
    public partial class DaftarItem : UserControl
    {
        public DaftarItem()
        {
            InitializeComponent();

            DataView dv = new DataView();
            dv.Table = DataManager.GetData("select * from tbl_item");
            
            this.DataContext = dv;
        }

        private void btnEditData_Click(object sender, RoutedEventArgs e)
        {
            
        }

        private void btnHapus_Click(object sender, RoutedEventArgs e)
        {
            dg.DeleteItems();
        }

        private void btnTambah_Click(object sender, RoutedEventArgs e)
        {
            Shell.Current.Show("Tambah Item", new DaftarItemEdit());
        }

        private void btnKeluar_Click(object sender, RoutedEventArgs e)
        {
            DataView dv = (DataView)this.DataContext;

            dv.Table.AcceptChanges();

            Shell.Current.Close("Data Barang");
        }
                
    }

 
}
